PreviousNextTracker indexSee it online !

(174/308) 1458 - TextTools: Toggle Line Comment case sensitive

In batch.xml rem is declared as line comment property. Rule ignore_case="true".
Trying to toggle a line like this:

REM copy asdf

results in:

rem REM copy asdf

Desired behaviour: uncomment line.

Submitted jarekczek - 2011-09-26 14:47:11 Assigned
Priority 5 Labels
Status pending Group
Resolution fixed

Comments

2017-11-01 13:08:33.242000
ngc

The problem here is that "lineComment" is defined in PROPS while case-sensitivity is defined per ruleset.

So there is no way (currently) to define that the lineComment string is case insensitive.

My proposal would be to simply treat EVERY lineComment as being case-insensitive.

For this, change in TextToolComments.java

Line 126 from

if(line.length() > 0 && !line.startsWith(lineComment))

to

if(line.length() > 0 && !line.toLowerCase().startsWith(lineComment.toLowerCase()))

and line 172 from

if(line.trim().startsWith(lineComment) && doUncomment)

to

if(line.trim().toLowerCase().startsWith(lineComment.toLowerCase()) && doUncomment)

2017-11-02 07:00:33.322000
ngc

- **status**: open --> pending-fixed
- **Group**: -->